Skip to content

feat(server): migrate controls routes to auth framework#212

Merged
abhinav-galileo merged 6 commits into
mainfrom
abhi/controls-auth-framework
May 15, 2026
Merged

feat(server): migrate controls routes to auth framework#212
abhinav-galileo merged 6 commits into
mainfrom
abhi/controls-auth-framework

Conversation

@abhinav-galileo

@abhinav-galileo abhinav-galileo commented May 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Move /controls and /control-templates/render onto operation-based auth.
  • Keep GET /controls/schema public because it returns static metadata.
  • Require CONTROLS_CREATE for validate and render because both use the authoring path.
  • Preserve no-auth deployment mode.

Behavior Change

  • POST /controls/validate and POST /control-templates/render now require create access under the default header provider.

Testing

@codecov

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@abhinav-galileo abhinav-galileo changed the title feat(server): migrate /controls + /control-templates onto auth framework feat(server): migrate controls routes to auth framework May 8, 2026
@abhinav-galileo abhinav-galileo force-pushed the abhi/controls-auth-framework branch from ad586bb to 3a5b7e4 Compare May 8, 2026 15:28
@abhinav-galileo abhinav-galileo marked this pull request as ready for review May 8, 2026 18:35
Comment thread server/src/agent_control_server/endpoints/controls.py
Comment thread server/src/agent_control_server/endpoints/controls.py
@abhinav-galileo abhinav-galileo force-pushed the abhi/controls-auth-framework branch 2 times, most recently from e75cbb7 to 2935d2d Compare May 12, 2026 08:22
Comment thread sdks/typescript/src/generated/models/security.ts
Comment thread server/src/agent_control_server/endpoints/controls.py Outdated
Mirrors #204's bindings migration: replaces require_admin_key and
router-level require_api_key with require_operation(CONTROLS_*) on
every protected route on /controls and on /control-templates/render.
Both routers now mount with the non-validating
get_api_key_from_header so the framework owns authentication and
authorization, with the extractor attached purely so the generated
OpenAPI advertises X-API-Key.

GET /controls/schema is intentionally left without a
require_operation dependency: it returns a static model schema with
no tenant state and routing it through the framework would force the
upstream provider to handle a meta-only operation that has no
permission semantics.

POST /controls/validate and POST /control-templates/render are wired
to CONTROLS_CREATE rather than CONTROLS_READ. Both exercise the
authoring materialization path and exist to support the create / set-
data flow; a caller who cannot create controls has no use for the
result. Backwards-incompatible for OSS deployments that previously
called these routes with non-admin keys; deployments that want the
old behavior can override with
HeaderAuthProvider(operation_access={...}).

Storage namespace continues to come from get_namespace_key, matching
the bindings migration in #204. The unified principal-derived cutover
across /controls, /policies, /agents, and /evaluation is a follow-up.
…utes

Move auth-framework rationale on /controls/schema, /controls/validate,
and /control-templates/render from route docstrings into normal code
comments. The docstrings flow into the generated TypeScript SDK as
public API documentation, so internal terminology like
``require_operation`` and "upstream authorizer" should not appear
there. Function-level comments preserve the rationale for readers of
the source.

Also remove the skipped placeholder test for the project-scoped
credential deny scenario; that scenario depends on a deployment-side
provider configuration that is not part of the OSS server, so
tracking it as a permanent skipped test in this repo was the wrong
home for it.

Regenerate the TypeScript SDK to drop the leaked rationale lines.
@abhinav-galileo abhinav-galileo force-pushed the abhi/controls-auth-framework branch from fba36df to 3cd0ee1 Compare May 15, 2026 08:29
@abhinav-galileo abhinav-galileo merged commit 764bd4b into main May 15, 2026
6 checks passed
@abhinav-galileo abhinav-galileo deleted the abhi/controls-auth-framework branch May 15, 2026 11:38
galileo-automation pushed a commit that referenced this pull request May 28, 2026
## [2.6.0](ts-sdk-v2.5.0...ts-sdk-v2.6.0) (2026-05-28)

### Features

* **evaluators:** add new lluna client ([#213](#213)) ([f65beb9](f65beb9))
* **sdk:** add otel support ([#177](#177)) ([9530368](9530368))
* **sdk:** add runtime token auth ([#215](#215)) ([6cc0f38](6cc0f38))
* **server:** add control clone-and-bind endpoint ([#229](#229)) ([1728bf9](1728bf9))
* **server:** add runtime auth and namespace scoping ([#214](#214)) ([56e44fe](56e44fe))
* **server:** allow host-owned logging setup ([#227](#227)) ([c0fd159](c0fd159))
* **server:** bundle migrations in wheel and add agent-control-migrate ([#209](#209)) ([8c5c35e](8c5c35e))
* **server:** migrate controls routes to auth framework ([#212](#212)) ([764bd4b](764bd4b))

### Bug Fixes

* **examples:** declare local SDK workspace deps ([#222](#222)) ([d22aa1d](d22aa1d))
* **sdk:**  Get trace context from provider ([#211](#211)) ([1efe30f](1efe30f))
* **sdk-ts:** normalize generated client ([#231](#231)) ([1c097d2](1c097d2))
* **server:** make observability migration retry-safe ([#226](#226)) ([b9dd00d](b9dd00d))
* **server:** prevent migration lock transactions ([#224](#224)) ([e65a2f4](e65a2f4))
* **server:** scope auth upstream CA to HTTP provider ([#232](#232)) ([7a0ce21](7a0ce21))
* **ui:** fix editing of controls in the UI ([#218](#218)) ([981e33d](981e33d)), closes [#Risk](https://github.com/agentcontrol/agent-control/issues/Risk)
@galileo-automation

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 2.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants